<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li class="active">
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li class="active">
				订单管理
			</li>
			<li class="active">
				订单列表
			</li>
		</ul><!-- .breadcrumb -->
	</div>

	<div class="page-content">
		<div class="row">
			<div class="page-header">
				<h1>订单列表</h1>
			</div>
 
	        <div class="col-md-12 col-sm-12 col-xs-12 form">
	        <form action="<?php echo base_url().'crm/order/query'?>" method="get">
	        	<div class="row">
	        	    <div class="wh">
                	<label>订单编号：</label>
                    <input type="text" name="order_no" value="<?php if (isset($order_no)) echo $order_no;?>"/>
                    </div>
                    <div class="wh">
                	<label>手机号码：</label>
                    <input type="text" name="user_phone" value="<?php if (isset($user_phone)) echo $user_phone;?>"/>
                    </div>
                    <div class="wh">
                    	<label>设备类型：</label>
                    	<select name="device_category_id" id="device_category_id" style="height: 23px;">
                            <option value="">全部</option>
                            <?php if (isset($category)){
                                foreach ($category as $val){
                            ?>
							<option value="<?php echo $val->id;?>" <?php if (isset($device_category_id)&&$device_category_id == $val->id)echo "selected";?>><?php echo $val->name;?></option>
							<?php }
                                }?>
						</select>
                    </div>
                    <div class="wh">
                	<label>订单状态：</label>
                    	<select name="status" id="status" style="height: 23px;">
                    		<option value="">全部</option>
                    		<option value="1" <?php if (isset($status)&&$status == '1')echo "selected";?>>抢单中</option>
                    		<option value="2" <?php if (isset($status)&&$status == '2')echo "selected";?>>等待客户确认</option>
                    		<option value="3" <?php if (isset($status)&&$status == '3')echo "selected";?>>确认使用</option>
                    		<option value="4" <?php if (isset($status)&&$status == '4')echo "selected";?>>致电客户</option>
                    		<option value="5" <?php if (isset($status)&&$status == '5')echo "selected";?>>确认开始</option>
                    		<option value="6" <?php if (isset($status)&&$status == '6')echo "selected";?>>确认结束</option>
                    		<option value="7" <?php if (isset($status)&&$status == '7')echo "selected";?>>订单取消</option>
                    		<option value="8" <?php if (isset($status)&&$status == '8')echo "selected";?>>投诉中</option>
                    	</select>
                    </div>
                    <div class="wh">
                	<label>支付方式：</label>
                    	<select name="payment_id" id="payment_id" style="height: 23px;">
                    		<option value="">全部</option>
                    		<option value="1" <?php if (isset($payment_id)&&$payment_id == '1')echo "selected";?>>现金支付</option>
                    		<option value="3" <?php if (isset($payment_id)&&$payment_id == '3')echo "selected";?>>微信公众号支付</option>
                    		<option value="6" <?php if (isset($payment_id)&&$payment_id == '6')echo "selected";?>>支付宝APP支付</option>
                    		<option value="7" <?php if (isset($payment_id)&&$payment_id == '7')echo "selected";?>>微信APP支付</option>
							<option value="9" <?php if (isset($payment_id)&&$payment_id == '9')echo "selected";?>>小程序支付</option>
                    	</select>
                    </div>
                    <div class="col-xs-4 sell_btn">
    	        	<button class="btn btn-sm btn-info" type="submit"><i class="icon-search"></i>查询</button>
    	        	
	                </div>     
	            </div>
	            
	        </div>
	        
	        </form>

        	<div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
				<form action="" method="post" id="delForm">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center" style="width: 3%;">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>订单编号</th>
                                <th>手机号码</th>
                                <th>设备大类</th>
                                <th>设备规格</th>
                                <th>订单状态</th>
                                <th>支付方式</th>
                                <th>支付状态</th>
                                <th>订单总额</th>
                                <th>订单类型</th>
                                <th>联系人姓名</th>
                                <th>联系人电话</th>
                                <th>下单时间</th>
                                <th>操作</th>
							</tr>
						</thead>

						<tbody>
							<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $app){
                            	?>
							<tr>
								<td class="center">
                                	<p>
									<label>
										<input type="checkbox" class="ace" name="num[]" value="<?php echo $app->id;?>"/>
										<span class="lbl"></span>
									</label>
                                    </p>
								</td>
								<td><p><?php echo $app->order_no;?></p></td>
                                <td><p><?php echo $app->user_phone;?></p></td>
                                <td><p><?php echo $app->category_name;?></p></td>
                                <td><p><?php echo $app->type_name;?></p></td>
                                <td><p><?php 
                                	if($app->status == 0){
                                		echo "未完成";
                                	}elseif($app->status == 1){
                                		echo "抢单中";
                                	}elseif($app->status == 2){
                                		echo "等待客户确认";
                                	}elseif($app->status == 3){
                                		echo "确认使用";
                                	}elseif($app->status == 4){
                                		echo "致电客户";
                                	}elseif($app->status == 5){
                                		echo "确认开始";
                                	}elseif($app->status == 6){
                                		echo "确认结束";
                                	}elseif($app->status == 7){
                                		echo "订单取消";
                                	}elseif($app->status == 8){
                                		echo "投诉中";
                                	}
                                	?></p></td>
                                <td><p><?php echo $app->payment;?></p></td>
                                <td><p><?php 
                                	if($app->payment_status == 0){
                                		echo "未支付";
                                	}elseif($app->payment_status == 1){
                                		echo "已支付";
                                	}
                                	?></p></td>
                            	<td><p><?php echo $app->order_price.'+'.$app->order_tip;?></p></td>
                            	<td><p><?php 
                                	if($app->order_type == 1){
                                		echo "即时";
                                	}elseif($app->order_type == 2){
                                		echo "预约";
                                	}
                                	?></p></td>
                            	<td><p><?php echo $app->contact_name;?></p></td>
                            	<td><p><?php echo $app->contact_phone;?></p></td>
                                <td><p><?php echo $app->create_time;?></p></td>
                                <td><p>
	                               
									    <a class="btn btn-sm btn-info" href="<?php echo base_url().'crm/order/look/'.$app->id;?>"><i class="icon-edit"></i>详细</a>
	                            
	                                
                                    </p>
                                </td>
    						</tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="15">无数据</td>
                            </tr>
                            <?php }?>
						</tbody>
					</table>
					</form>
				</div><!-- /.table-responsive -->
			</div>
        
        	<div class="col-sm-12">
            	<div class="modal-footer no-margin-top">
                	<div class="pull-left record">
						共<?php echo $count;?>条记录
                    </div>
            		<?php if (isset($page))echo $page;?>
            	</div>
            </div>
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->


	